package com.tyf.bookreader.controller;

import com.tyf.bookreader.dto.BookDto;
import com.tyf.bookreader.service.BookService;
import com.tyf.bookreader.component.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Description 首页模块
 * @Author shallow
 * @Date 2023/4/1 18:06
 */
@Api(tags = "首页模块")
@RestController
@RequestMapping("home")
public class HomeController {

    @Autowired
    private BookService bookService;

    @ApiOperation(value = "获取热门书籍")
    @GetMapping("/hotBook")
    public Result<List<BookDto>> getHotBook(){
        return bookService.getHotBook();
    }

//    @ApiOperation(value = "获取热门新闻")
//    @RequestMapping("/hotNews")

}
